<include file="Public:header" />
<include file="Public:leftside" />
<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb">
			<li> <i class="icon-home home-icon"></i> <a href="/">首页</a> </li>
			<li class="active">网站碎片</li>
		</ul>
	</div>
	<div class="row panel-body" style="padding: 21px 0 0 36px;">
			<a href="/Platform/ad.html" class="btn btn-sm btn-primary"> 碎片管理 </a>
			<a href="{:U('Platform/ad_add')}" class="btn btn-sm btn-default">添加碎片</a>
	</div>
	<section class="scrollable wrapper" style="padding: 20px;padding-bottom: 0;">
		
		<section class="panel-default m-b-sm" style="margin-bottom: 0;">
					<div class="alert alert-info" style="margin-bottom: 0;">
						<p>
							<button type="button" class="close"><i class="fa fa-minus"></i></button>
							<i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
						</p>
						<p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>编辑/添加碎片</p>
						<p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>重要：请不要随便改变碎片名称</p>
					</div>
		</section>
	</section>
	<div class="page-content">
		<table id="sample-table-1" class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th class="center" width="50">ID</th>
					<th>碎片名称</th>
					<th>调用代码</th>
					<th width="100">状态</th>
					<th width="150">操作</th>
					
				</tr>
			</thead>
			<tbody>
				<volist name="rs" id="row">
					<tr>
						<td><?=$row['ad_id']?></td>
						<td style="font-weight:bold;">
							<?=$row['ad_name']?>
						</td> 
						<php>$usercode="{".":sp_getad('".$row['ad_name']."')}";</php>
						<td>{$usercode}</td>
						<php>$status=array("1"=>'显示',"0"=>'隐藏'); </php>
						<td>{$status[$row['status']]}</td>
						<td>
							<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
								<a href="{:U('Platform/ad_add',array('id'=>$row['ad_id']))}">编辑</a> |
								<a href="{:U('Platform/ad_del',array('id'=>$row['ad_id']))}"  onclick="if(confirm('确定删除?')==false)return false;">删除</a> 
							</div>
						</td>
					</tr>
				</volist>
			</tbody>
		</table>
	</div>
</div>

<include file="Public:footer" />